__author__='zxd'
__date__='2018/2/9'

import xadmin
from .models import EmailVerifyRecord
from .models import Banner
from xadmin import views

#邮箱验证码模块功能注册
class EmailVerifyRecordAdmin(object):
	#后台展示的列
	list_display=['code','email','send_type','send_time']
	#可搜索的字段
	search_fields=['code', 'email', 'send_type']
	#过滤器
	list_filter=['code', 'email', 'send_type', 'send_time']


class BannerAdmin(object):
	list_display=['title', 'image', 'url', 'index', 'add_time']
	search_fields=['title', 'image', 'url', 'index']
	list_filter=['title', 'image', 'url', 'index', 'add_time']

class GlobalSettings(object):
	site_title='后台管理系统' #设置后台名字
	site_footer='学习网'      #设置@
	menu_style='accordion'    #设置菜单缩放
				
		
#注册邮箱验证码
xadmin.site.register(EmailVerifyRecord, EmailVerifyRecordAdmin)
#注册轮播
xadmin.site.register(Banner, BannerAdmin)
xadmin.site.register(views.CommAdminView, GlobalSettings)

